#include "Particle.h"


Particle::Particle(Emitter* emitter)
{
	m_Emitter = emitter;


}

Particle::Particle( Emitter* emitter, float X, float Y, float Z, float velX, float velY, float velZ, float scale /*= 1*/, float lifetime )
{
	m_Emitter = emitter;
	PosX = X;
	PosY = Y;
	PosZ = Z;

	VelX = velX;
	VelY = velY;
	VelZ = velZ;

	Scale = scale;

	LifeTime = lifetime;
	
}


Particle::~Particle(void)
{
}

void Particle::Update( float elapsedTime, bool time /*= false*/, bool circle /*= false*/ )
{
	LifeTime -= elapsedTime;

	if(time)
	{
		VelX += Ave_X * elapsedTime;
		VelY += Ave_Y * elapsedTime;
		VelZ += Ave_Z * elapsedTime;
	}

	Scale -= Ave_Scale * elapsedTime;

	PosX += VelX * elapsedTime;
	PosY += VelY * elapsedTime;
	PosZ += VelZ * elapsedTime;
}

void Particle::Render( void )
{

}

void Particle::SetAverages( void )
{
	//Ave_X = (m_Emitter->StartVel_X - m_Emitter->StopVel_X) / m_Emitter->LifeTime;
}
